#include <stdio.h>
 
int main()
{
    int m = 0;
    int n = 0;
    scanf("%d %d", &m, &n);
    int min = m < n ? m : n;
    while(m % min != 0 || n % min != 0)
    {
        min--;
    }
    printf("最大公约数为:%d\n", min);
    return 0;
}